package commons.test;

import java.net.Socket;
import java.util.ArrayList;
import java.util.List;

import network.communication.Connection;
import network.communication.ConnectionFactory;

public class DummyConnectionFactory implements ConnectionFactory {

	private List<Connection>	connectionsToRespond;

	@Override
	public Connection createConnection(final Socket socket) {
		return connectionsToRespond.remove(0);
	}

	public void setConnectionsToRespond(final List<Connection> connections) {
		connectionsToRespond = new ArrayList<Connection>(connections);
	}
}
